﻿using HuiZe.education.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HuiZe.education.View
{
    /// <summary>
    /// PART_MyPackages_Vertical.xaml 的交互逻辑
    /// </summary>
    public partial class PART_MyPackages_Vertical : UserControl
    {
        /// <summary>
        /// 下载
        /// </summary>
        public Action<ResMyBkResourceDetailItemModel> DownloadCallback { get; set; }
        /// <summary>
        /// 删除
        /// </summary>
        public Action<ResMyBkResourceDetailItemModel> DeleteCallback { get; set; }
        /// <summary>
        /// 分享
        /// </summary>
        public Action<ResMyBkResourceDetailItemModel> ShareCallback { get; set; }
        /// <summary>
        /// 修改
        /// </summary>
        public Action<ResMyBkResourceDetailItemModel> EditCallback { get; set; }
        /// <summary>
        /// 置顶
        /// </summary>
        public Action<ResMyBkResourceDetailItemModel> TopCallback { get; set; }
        /// <summary>
        /// 上课
        /// </summary>
        public Action<ResMyBkResourceDetailItemModel> LessonCallback { get; set; }


        public PART_MyPackages_Vertical()
        {
            InitializeComponent();
        }

        public void Load(List<ResMyBkResourceDetailItemModel> _list)
        {
            PART_Items.ItemsSource = _list;
        }

        void PART_MyPackage_Item_Loaded(object sender, RoutedEventArgs e)
        {
            PART_MyPackage_Item_Vertical _item = (PART_MyPackage_Item_Vertical)sender;
            _item.DownloadCallback = DownloadCallback;
            _item.DeleteCallback = DeleteCallback;
            _item.ShareCallback = ShareCallback;
            _item.EditCallback = EditCallback;
            _item.TopCallback = TopCallback;
            _item.LessonCallback = LessonCallback;

            _item.Load_Image();
        }
    }
}
